package com.lyl.quartz.jobs;

import com.lyl.quartz.utils.TimeUtil;
import org.quartz.Job;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;

import java.util.Date;
import java.util.StringJoiner;

/**
 * @author lylbell
 * @date 2022-03-29 10:59
 */
public class HelloJob implements Job {
    @Override
    public void execute(JobExecutionContext context) {
        StringJoiner stringJoiner = new StringJoiner(" ")
                .add("Hello Job")
                .add(TimeUtil.parse(new Date()))
                .add(Thread.currentThread().getName())
                .add(context.getTrigger().getKey().getName());
        System.out.println(stringJoiner);
    }
}
